#-*- coding: utf-8 -*-
#===============================================================================
# Koro Business Environment
# Copyright (C) 2008  Antonio Corroppoli
#
#This file is part of Koro BE.
# 
# Koro BE is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# Koro BE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Koro BE; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#===============================================================================
# Settings
class Settings(object):
    APP_NAME = 'Koro Business Environment'
    #<GUI> 
    UI_TYPE = uiType = "mell"
    #<LANGUAGE>
    LANG = language = "IT"
    # Default encoding to use when none is specified
    DEFAULT_ENCODING = defaultEncoding = "utf-8"
    #----------------------------#
    #-----Database settings------#
    #----------------------------#
    #database type
    DB_TYPE  = "sqlite"
    #schema
    DB_NAME = "korobe.db"
    DB_PATH = ''
    #cartella utente
    USER_HOME = ''
    #koroBE config file
    KOROBE_CFG = 'KoroBE.cfg'
    #KoroBE dir
    KOROBE_DIR_NAME = 'KoroBE'
    KOROBE_DIR = ''
    #Se true i dati cancellati vengono salvati in un cestino nascosto
    TRASH = True

    #lista dei moduli abilitati
    ENABLED_MODULES=['agenda','commerciale','anagrafiche','prodotti','magazzino']

    #simbolo euro
    EURO='€ '

    #non modificare!!!
    TIPI_LISTINO=["Vendita","Acquisto","Generico"]

    #percorso template di stampa
    TEMPLATE_PATH='/home/antstud/koro/templates/'

    #PERCORSO OUTPUT FILE PDF
    PDF_PATH='/home/antstud/koro/pdf/'

    #visualizzatore di documenti pdf
    PDF_VIEWER='evince '

    #template stampa fatture
    TEMPLATE_FATTURA='template_fattura.html'
    TEMPLATE_PREVENTIVO='template_preventivo.html'

    def __init__(self):
        import os, sys
        if sys.platform.startswith('win'):
            Settings.USER_HOME=os.environ['USERPROFILE']
        else:
            Settings.USER_HOME=os.environ['HOME']
        Settings.KOROBE_DIR = os.path.join(os.path.normpath(Settings.USER_HOME),
                                  os.path.normpath(Settings.KOROBE_DIR_NAME))
        if not os.path.isdir(Settings.KOROBE_DIR):
            os.mkdir(Settings.KOROBE_DIR)
        Settings.DB_PATH = os.path.join(os.path.normpath(Settings.KOROBE_DIR),
                               os.path.normpath(Settings.DB_NAME))
        